<template>
    <el-dialog title="附件查看" :visible="visible" width="800px" @close="onClose" @open="onOpen">
        <div>
            <FileComponent2 :files="files" type="look"/>
        </div>
        <span slot="footer" class="dialog-footer">
            <!-- <el-button class="bottom_all_two" @click="onClose">取 消</el-button>
            <el-button class="bottom_all" type="primary" @click="onConfirm">确 定</el-button> -->
            <el-button class="bottom_all_two" @click="onClose">关 闭</el-button>
        </span>
    </el-dialog>
</template>

<script>
    import FileComponent2 from '@/views/platform/ICPS/internetSales/components/fileComponent';
    export default {
        components: {
            FileComponent2
        },
        data() {
            return {
                files: []
            };
        },
        props: {
            config: {
                type: Object,
                default: () => {},
            },
            // 控制dialog显示
            visible: {
                type: Boolean,
            },
        },
        methods: {
            onOpen() {
                this.files = JSON.parse(this.config.filePaths)
            },
            onClose() {
                this.$emit('update:visible', false);
            },
            onConfirm() {
                this.$emit('updated', false);
                this.$emit('update:visible', false);
            },

        },
    };
</script>

<style lang="scss" scoped>
</style>
